package com.github.tangmonkmeat;

import java.util.Arrays;
import java.util.Scanner;

/**
 * Description:
 *
 * @author zwl
 * @version 1.0
 * @date 2021/8/5 上午11:21
 */
public class Test {

    public static void main(String[] args){
        try(Scanner sc = new Scanner(System.in)){
            final int n = sc.nextInt();
            int[] arr = new int[n];
            for(int i = 0;i < arr.length;i++){
                arr[i] = sc.nextInt();
            }
            Arrays.sort(arr);
            System.out.println(def(arr,n));
        }
    }

    public static int def(int[] arr,int n){
        int count = 0;
        while(arr[arr.length - 1] >= n){
            count++;
            arr[arr.length - 1] = arr[arr.length - 1] - n;
            for(int i = 0;i < arr.length - 1;i++){
                arr[i]++;
            }
            Arrays.sort(arr);
        }

        return count;
    }

}
